
from abc import ABC, abstractmethod
from contextlib import AsyncExitStack

from ..common import MCPServerConfig, ModelParameter
from ..providers import LLMClient 

class BaseMCPClient(ABC):
    """Implementation for a single MCP server."""
    def __init__(self, 
            mcp_server: str, 
            mcp_config: MCPServerConfig, 
            model_param: ModelParameter):
        self.server = mcp_server
        self.mcp_config = mcp_config
        self.exit_stack = AsyncExitStack()
        # create LLM connection client
        self.model=LLMClient(
            provider=model_param.provider, model_param=model_param)

    @abstractmethod
    async def start(self)->bool:
        pass
    
    @abstractmethod
    async def ping(self)->bool:
        pass

    @abstractmethod
    async def cleanup(self):
        """Clean up resources"""
        pass
